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

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

@FirstNode = external dso_local global ptr, align 8
@.str = external hidden unnamed_addr constant [64 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@__PRETTY_FUNCTION__.AdjustCandidateSet = external hidden unnamed_addr constant [26 x i8], align 1
@C = external dso_local global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [96 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @AdjustCandidateSet() #0 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca %struct.Candidate, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %7 = load ptr, ptr @FirstNode, align 8, !tbaa !5
  store ptr %7, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  br label %8

8:                                                ; preds = %175, %0
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 43
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = icmp ne ptr %11, null
  br i1 %12, label %21, label %13

13:                                               ; preds = %8
  %14 = call noalias ptr @calloc(i64 noundef 3, i64 noundef 16) #7
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.Node, ptr %15, i32 0, i32 43
  store ptr %14, ptr %16, align 8, !tbaa !9
  %17 = icmp ne ptr %14, null
  br i1 %17, label %18, label %19

18:                                               ; preds = %13
  br label %20

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

20:                                               ; preds = %18
  br label %21

21:                                               ; preds = %20, %8
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.Node, ptr %22, i32 0, i32 15
  %24 = load ptr, ptr %23, align 8, !tbaa !13
  store ptr %24, ptr %5, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %102, %21
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %104

28:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !14
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.Node, ptr %29, i32 0, i32 43
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  store ptr %31, ptr %1, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %48, %28
  %33 = load ptr, ptr %1, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.Candidate, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %43

37:                                               ; preds = %32
  %38 = load ptr, ptr %1, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.Candidate, ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = icmp ne ptr %40, %41
  br label %43

43:                                               ; preds = %37, %32
  %44 = phi i1 [ false, %32 ], [ %42, %37 ]
  br i1 %44, label %45, label %51

45:                                               ; preds = %43
  %46 = load i32, ptr %6, align 4, !tbaa !14
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %6, align 4, !tbaa !14
  br label %48

48:                                               ; preds = %45
  %49 = load ptr, ptr %1, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.Candidate, ptr %49, i32 1
  store ptr %50, ptr %1, align 8, !tbaa !5
  br label %32, !llvm.loop !17

51:                                               ; preds = %43
  %52 = load ptr, ptr %1, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.Candidate, ptr %52, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !15
  %55 = icmp ne ptr %54, null
  br i1 %55, label %90, label %56

56:                                               ; preds = %51
  %57 = load ptr, ptr @C, align 8, !tbaa !5
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = call i32 %57(ptr noundef %58, ptr noundef %59)
  %61 = load ptr, ptr %1, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.Candidate, ptr %61, i32 0, i32 1
  store i32 %60, ptr %62, align 8, !tbaa !19
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = load ptr, ptr %1, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.Candidate, ptr %64, i32 0, i32 0
  store ptr %63, ptr %65, align 8, !tbaa !15
  %66 = load ptr, ptr %1, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.Candidate, ptr %66, i32 0, i32 2
  store i32 2147483647, ptr %67, align 4, !tbaa !20
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.Node, ptr %68, i32 0, i32 43
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  %71 = load i32, ptr %6, align 4, !tbaa !14
  %72 = add nsw i32 %71, 2
  %73 = sext i32 %72 to i64
  %74 = mul i64 %73, 16
  %75 = call ptr @realloc(ptr noundef %70, i64 noundef %74) #9
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.Node, ptr %76, i32 0, i32 43
  store ptr %75, ptr %77, align 8, !tbaa !9
  %78 = icmp ne ptr %75, null
  br i1 %78, label %79, label %80

79:                                               ; preds = %56
  br label %81

80:                                               ; preds = %56
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 44, ptr noundef @__PRETTY_FUNCTION__.AdjustCandidateSet) #8
  unreachable

81:                                               ; preds = %79
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.Node, ptr %82, i32 0, i32 43
  %84 = load ptr, ptr %83, align 8, !tbaa !9
  %85 = load i32, ptr %6, align 4, !tbaa !14
  %86 = add nsw i32 %85, 1
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.Candidate, ptr %84, i64 %87
  %89 = getelementptr inbounds %struct.Candidate, ptr %88, i32 0, i32 0
  store ptr null, ptr %89, align 8, !tbaa !15
  br label %90

90:                                               ; preds = %81, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %91

91:                                               ; preds = %90
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.Node, ptr %93, i32 0, i32 15
  %95 = load ptr, ptr %94, align 8, !tbaa !13
  %96 = icmp eq ptr %92, %95
  br i1 %96, label %97, label %101

97:                                               ; preds = %91
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.Node, ptr %98, i32 0, i32 16
  %100 = load ptr, ptr %99, align 8, !tbaa !21
  br label %102

101:                                              ; preds = %91
  br label %102

102:                                              ; preds = %101, %97
  %103 = phi ptr [ %100, %97 ], [ null, %101 ]
  store ptr %103, ptr %5, align 8, !tbaa !5
  br label %25, !llvm.loop !22

104:                                              ; preds = %25
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.Node, ptr %105, i32 0, i32 43
  %107 = load ptr, ptr %106, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.Candidate, ptr %107, i64 1
  store ptr %108, ptr %1, align 8, !tbaa !5
  br label %109

109:                                              ; preds = %171, %104
  %110 = load ptr, ptr %1, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.Candidate, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !15
  store ptr %112, ptr %5, align 8, !tbaa !5
  %113 = icmp ne ptr %112, null
  br i1 %113, label %114, label %174

114:                                              ; preds = %109
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.Node, ptr %115, i32 0, i32 19
  %117 = load ptr, ptr %116, align 8, !tbaa !23
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = icmp eq ptr %117, %118
  br i1 %119, label %126, label %120

120:                                              ; preds = %114
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.Node, ptr %121, i32 0, i32 19
  %123 = load ptr, ptr %122, align 8, !tbaa !23
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = icmp eq ptr %123, %124
  br i1 %125, label %126, label %170

126:                                              ; preds = %120, %114
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.Node, ptr %127, i32 0, i32 20
  %129 = load ptr, ptr %128, align 8, !tbaa !24
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = icmp eq ptr %129, %130
  br i1 %131, label %150, label %132

132:                                              ; preds = %126
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.Node, ptr %133, i32 0, i32 20
  %135 = load ptr, ptr %134, align 8, !tbaa !24
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = icmp eq ptr %135, %136
  br i1 %137, label %150, label %138

138:                                              ; preds = %132
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.Node, ptr %139, i32 0, i32 33
  %141 = load ptr, ptr %140, align 8, !tbaa !25
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = icmp eq ptr %141, %142
  br i1 %143, label %150, label %144

144:                                              ; preds = %138
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.Node, ptr %145, i32 0, i32 33
  %147 = load ptr, ptr %146, align 8, !tbaa !25
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = icmp eq ptr %147, %148
  br i1 %149, label %150, label %170

150:                                              ; preds = %144, %138, %132, %126
  %151 = load ptr, ptr %1, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %151, i64 16, i1 false), !tbaa.struct !26
  %152 = load ptr, ptr %1, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.Candidate, ptr %152, i64 -1
  store ptr %153, ptr %2, align 8, !tbaa !5
  br label %154

154:                                              ; preds = %164, %150
  %155 = load ptr, ptr %2, align 8, !tbaa !5
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.Node, ptr %156, i32 0, i32 43
  %158 = load ptr, ptr %157, align 8, !tbaa !9
  %159 = icmp uge ptr %155, %158
  br i1 %159, label %160, label %167

160:                                              ; preds = %154
  %161 = load ptr, ptr %2, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.Candidate, ptr %161, i64 1
  %163 = load ptr, ptr %2, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %162, ptr align 8 %163, i64 16, i1 false), !tbaa.struct !26
  br label %164

164:                                              ; preds = %160
  %165 = load ptr, ptr %2, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.Candidate, ptr %165, i32 -1
  store ptr %166, ptr %2, align 8, !tbaa !5
  br label %154, !llvm.loop !27

167:                                              ; preds = %154
  %168 = load ptr, ptr %2, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.Candidate, ptr %168, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %169, ptr align 8 %3, i64 16, i1 false), !tbaa.struct !26
  br label %170

170:                                              ; preds = %167, %144, %120
  br label %171

171:                                              ; preds = %170
  %172 = load ptr, ptr %1, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.Candidate, ptr %172, i32 1
  store ptr %173, ptr %1, align 8, !tbaa !5
  br label %109, !llvm.loop !28

174:                                              ; preds = %109
  br label %175

175:                                              ; preds = %174
  %176 = load ptr, ptr %4, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.Node, ptr %176, i32 0, i32 16
  %178 = load ptr, ptr %177, align 8, !tbaa !21
  store ptr %178, ptr %4, align 8, !tbaa !5
  %179 = load ptr, ptr @FirstNode, align 8, !tbaa !5
  %180 = icmp ne ptr %178, %179
  br i1 %180, label %8, label %181, !llvm.loop !29

181:                                              ; preds = %175
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #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,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #2

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

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #4

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

; 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) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind allocsize(0,1) "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 = { nounwind allocsize(1) "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0,1) }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind allocsize(1) }

!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 288}
!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, !6, i64 64}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"Candidate", !6, i64 0, !11, i64 8, !11, i64 12}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!16, !11, i64 8}
!20 = !{!16, !11, i64 12}
!21 = !{!10, !6, i64 72}
!22 = distinct !{!22, !18}
!23 = !{!10, !6, i64 96}
!24 = !{!10, !6, i64 104}
!25 = !{!10, !6, i64 208}
!26 = !{i64 0, i64 8, !5, i64 8, i64 4, !14, i64 12, i64 4, !14}
!27 = distinct !{!27, !18}
!28 = distinct !{!28, !18}
!29 = distinct !{!29, !18}


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

@FirstNode = external dso_local local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [64 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@__PRETTY_FUNCTION__.AdjustCandidateSet = external hidden unnamed_addr constant [26 x i8], align 1
@C = external dso_local local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [96 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @AdjustCandidateSet() local_unnamed_addr #0 {
  %1 = alloca %struct.Candidate, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1)
  %2 = load ptr, ptr @FirstNode, align 8, !tbaa !5
  br label %3

3:                                                ; preds = %._crit_edge87, %0
  %.049 = phi ptr [ %2, %0 ], [ %78, %._crit_edge87 ]
  %4 = getelementptr inbounds i8, ptr %.049, i64 288
  %5 = load ptr, ptr %4, align 8, !tbaa !9
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %6, label %9

6:                                                ; preds = %3
  %7 = tail call noalias dereferenceable_or_null(48) ptr @calloc(i64 noundef 3, i64 noundef 16) #6
  store ptr %7, ptr %4, align 8, !tbaa !9
  %.not56 = icmp eq ptr %7, null
  br i1 %.not56, label %8, label %9

8:                                                ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 29, ptr noundef nonnull @__PRETTY_FUNCTION__.AdjustCandidateSet) #7
  unreachable

9:                                                ; preds = %6, %3
  %10 = phi ptr [ %7, %6 ], [ %5, %3 ]
  %11 = getelementptr inbounds i8, ptr %.049, i64 64
  %12 = load ptr, ptr %11, align 8, !tbaa !13
  %.not5772 = icmp eq ptr %12, null
  br i1 %.not5772, label %._crit_edge, label %.lr.ph74

.lr.ph74:                                         ; preds = %9
  %13 = getelementptr inbounds i8, ptr %.049, i64 72
  br label %14

14:                                               ; preds = %.lr.ph74, %40
  %15 = phi ptr [ %12, %.lr.ph74 ], [ %37, %40 ]
  %16 = phi ptr [ %10, %.lr.ph74 ], [ %38, %40 ]
  %.04873 = phi ptr [ %12, %.lr.ph74 ], [ %41, %40 ]
  %17 = load ptr, ptr %16, align 8, !tbaa !14
  %.not6165 = icmp eq ptr %17, null
  %.not6266 = icmp eq ptr %17, %.04873
  %or.cond67 = or i1 %.not6165, %.not6266
  br i1 %or.cond67, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %14, %.lr.ph
  %.069 = phi i32 [ %18, %.lr.ph ], [ 0, %14 ]
  %.05168 = phi ptr [ %19, %.lr.ph ], [ %16, %14 ]
  %18 = add nuw nsw i32 %.069, 1
  %19 = getelementptr inbounds i8, ptr %.05168, i64 16
  %20 = load ptr, ptr %19, align 8, !tbaa !14
  %.not61 = icmp eq ptr %20, null
  %.not62 = icmp eq ptr %20, %.04873
  %or.cond = or i1 %.not61, %.not62
  br i1 %or.cond, label %.critedge, label %.lr.ph, !llvm.loop !16

.critedge:                                        ; preds = %.lr.ph, %14
  %.051.lcssa = phi ptr [ %16, %14 ], [ %19, %.lr.ph ]
  %.0.lcssa = phi i32 [ 0, %14 ], [ %18, %.lr.ph ]
  %.not61.lcssa = phi i1 [ %.not6165, %14 ], [ %.not61, %.lr.ph ]
  br i1 %.not61.lcssa, label %21, label %36

21:                                               ; preds = %.critedge
  %22 = load ptr, ptr @C, align 8, !tbaa !5
  %23 = tail call i32 %22(ptr noundef %.049, ptr noundef nonnull %.04873) #8
  %24 = getelementptr inbounds i8, ptr %.051.lcssa, i64 8
  store i32 %23, ptr %24, align 8, !tbaa !18
  store ptr %.04873, ptr %.051.lcssa, align 8, !tbaa !14
  %25 = getelementptr inbounds i8, ptr %.051.lcssa, i64 12
  store i32 2147483647, ptr %25, align 4, !tbaa !19
  %26 = load ptr, ptr %4, align 8, !tbaa !9
  %27 = add nuw nsw i32 %.0.lcssa, 2
  %28 = zext nneg i32 %27 to i64
  %29 = shl nuw nsw i64 %28, 4
  %30 = tail call ptr @realloc(ptr noundef %26, i64 noundef %29) #9
  store ptr %30, ptr %4, align 8, !tbaa !9
  %.not64 = icmp eq ptr %30, null
  br i1 %.not64, label %31, label %32

31:                                               ; preds = %21
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 44, ptr noundef nonnull @__PRETTY_FUNCTION__.AdjustCandidateSet) #7
  unreachable

32:                                               ; preds = %21
  %33 = zext nneg i32 %.0.lcssa to i64
  %34 = getelementptr inbounds %struct.Candidate, ptr %30, i64 %33
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  store ptr null, ptr %35, align 8, !tbaa !14
  %.pre = load ptr, ptr %11, align 8, !tbaa !13
  br label %36

36:                                               ; preds = %32, %.critedge
  %37 = phi ptr [ %.pre, %32 ], [ %15, %.critedge ]
  %38 = phi ptr [ %30, %32 ], [ %16, %.critedge ]
  %39 = icmp eq ptr %.04873, %37
  br i1 %39, label %40, label %._crit_edge

40:                                               ; preds = %36
  %41 = load ptr, ptr %13, align 8, !tbaa !20
  %.not57 = icmp eq ptr %41, null
  br i1 %.not57, label %._crit_edge, label %14, !llvm.loop !21

._crit_edge:                                      ; preds = %36, %40, %9
  %42 = phi ptr [ %10, %9 ], [ %38, %40 ], [ %38, %36 ]
  %.181 = getelementptr inbounds i8, ptr %42, i64 16
  %43 = load ptr, ptr %.181, align 8, !tbaa !14
  %.not5882 = icmp eq ptr %43, null
  br i1 %.not5882, label %._crit_edge87, label %.lr.ph86

.lr.ph86:                                         ; preds = %._crit_edge
  %44 = getelementptr inbounds i8, ptr %.049, i64 96
  %45 = getelementptr inbounds i8, ptr %.049, i64 104
  %46 = getelementptr inbounds i8, ptr %.049, i64 208
  br label %47

47:                                               ; preds = %.lr.ph86, %75
  %48 = phi ptr [ %43, %.lr.ph86 ], [ %76, %75 ]
  %.184 = phi ptr [ %.181, %.lr.ph86 ], [ %.1, %75 ]
  %.pn83 = phi ptr [ %42, %.lr.ph86 ], [ %.184, %75 ]
  %49 = load ptr, ptr %44, align 8, !tbaa !22
  %50 = icmp eq ptr %49, %48
  br i1 %50, label %55, label %51

51:                                               ; preds = %47
  %52 = getelementptr inbounds i8, ptr %48, i64 96
  %53 = load ptr, ptr %52, align 8, !tbaa !22
  %54 = icmp eq ptr %53, %.049
  br i1 %54, label %55, label %75

55:                                               ; preds = %51, %47
  %56 = load ptr, ptr %45, align 8, !tbaa !23
  %57 = icmp eq ptr %56, %48
  br i1 %57, label %69, label %58

58:                                               ; preds = %55
  %59 = getelementptr inbounds i8, ptr %48, i64 104
  %60 = load ptr, ptr %59, align 8, !tbaa !23
  %61 = icmp eq ptr %60, %.049
  br i1 %61, label %69, label %62

62:                                               ; preds = %58
  %63 = load ptr, ptr %46, align 8, !tbaa !24
  %64 = icmp eq ptr %63, %48
  br i1 %64, label %69, label %65

65:                                               ; preds = %62
  %66 = getelementptr inbounds i8, ptr %48, i64 208
  %67 = load ptr, ptr %66, align 8, !tbaa !24
  %68 = icmp eq ptr %67, %.049
  br i1 %68, label %69, label %75

69:                                               ; preds = %65, %62, %58, %55
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %.184, i64 16, i1 false), !tbaa.struct !25
  %70 = load ptr, ptr %4, align 8, !tbaa !9
  %.not6075 = icmp ult ptr %.pn83, %70
  br i1 %.not6075, label %._crit_edge79, label %.lr.ph78

.lr.ph78:                                         ; preds = %69, %.lr.ph78
  %.05076 = phi ptr [ %72, %.lr.ph78 ], [ %.pn83, %69 ]
  %71 = getelementptr inbounds i8, ptr %.05076, i64 16
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %71, ptr noundef nonnull align 8 dereferenceable(16) %.05076, i64 16, i1 false), !tbaa.struct !25
  %72 = getelementptr inbounds i8, ptr %.05076, i64 -16
  %73 = load ptr, ptr %4, align 8, !tbaa !9
  %.not60 = icmp ult ptr %72, %73
  br i1 %.not60, label %._crit_edge79, label %.lr.ph78, !llvm.loop !27

._crit_edge79:                                    ; preds = %.lr.ph78, %69
  %.050.lcssa = phi ptr [ %.pn83, %69 ], [ %72, %.lr.ph78 ]
  %74 = getelementptr inbounds i8, ptr %.050.lcssa, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %74, ptr noundef nonnull align 8 dereferenceable(16) %1, i64 16, i1 false), !tbaa.struct !25
  br label %75

75:                                               ; preds = %51, %65, %._crit_edge79
  %.1 = getelementptr inbounds i8, ptr %.184, i64 16
  %76 = load ptr, ptr %.1, align 8, !tbaa !14
  %.not58 = icmp eq ptr %76, null
  br i1 %.not58, label %._crit_edge87, label %47, !llvm.loop !28

._crit_edge87:                                    ; preds = %75, %._crit_edge
  %77 = getelementptr inbounds i8, ptr %.049, i64 72
  %78 = load ptr, ptr %77, align 8, !tbaa !20
  %79 = load ptr, ptr @FirstNode, align 8, !tbaa !5
  %.not59 = icmp eq ptr %78, %79
  br i1 %.not59, label %80, label %3, !llvm.loop !29

80:                                               ; preds = %._crit_edge87
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1)
  ret void
}

; 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 nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #4

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

; 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) #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 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) 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 #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 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind allocsize(0,1) }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(1) }

!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 288}
!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, !6, i64 64}
!14 = !{!15, !6, i64 0}
!15 = !{!"Candidate", !6, i64 0, !11, i64 8, !11, i64 12}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!15, !11, i64 8}
!19 = !{!15, !11, i64 12}
!20 = !{!10, !6, i64 72}
!21 = distinct !{!21, !17}
!22 = !{!10, !6, i64 96}
!23 = !{!10, !6, i64 104}
!24 = !{!10, !6, i64 208}
!25 = !{i64 0, i64 8, !5, i64 8, i64 4, !26, i64 12, i64 4, !26}
!26 = !{!11, !11, i64 0}
!27 = distinct !{!27, !17}
!28 = distinct !{!28, !17}
!29 = distinct !{!29, !17}


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