; LLVM IR from VAR-solutions/Algorithms :: Other Algorithms/Suffix Automaton/CPP/SA.ll (Z3addc)

; 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, %"class.std::map" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int>>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int>>, std::less<char>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

@st = external dso_local global [1000007 x %struct.node], align 16
@sz = external dso_local global i32, align 4
@last = external dso_local global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3addc(i8 noundef signext %0) #0 {
  %2 = alloca i8, align 1
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store i8 %0, ptr %2, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  %6 = load i32, ptr @sz, align 4, !tbaa !8
  %7 = add nsw i32 %6, 1
  store i32 %7, ptr @sz, align 4, !tbaa !8
  store i32 %6, ptr %3, align 4, !tbaa !8
  %8 = load i32, ptr @last, align 4, !tbaa !8
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %9
  %11 = getelementptr inbounds %struct.node, ptr %10, i32 0, i32 1
  %12 = load i32, ptr %11, align 4, !tbaa !10
  %13 = add nsw i32 %12, 1
  %14 = load i32, ptr %3, align 4, !tbaa !8
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %15
  %17 = getelementptr inbounds %struct.node, ptr %16, i32 0, i32 1
  store i32 %13, ptr %17, align 4, !tbaa !10
  br label %18

18:                                               ; preds = %39, %1
  %19 = load i32, ptr @last, align 4, !tbaa !8
  %20 = icmp ne i32 %19, -1
  br i1 %20, label %21, label %30

21:                                               ; preds = %18
  %22 = load i32, ptr @last, align 4, !tbaa !8
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %23
  %25 = getelementptr inbounds %struct.node, ptr %24, i32 0, i32 2
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %25, ptr noundef nonnull align 1 dereferenceable(1) %2)
  %27 = load i32, ptr %26, align 4, !tbaa !8
  %28 = icmp ne i32 %27, 0
  %29 = xor i1 %28, true
  br label %30

30:                                               ; preds = %21, %18
  %31 = phi i1 [ false, %18 ], [ %29, %21 ]
  br i1 %31, label %32, label %45

32:                                               ; preds = %30
  %33 = load i32, ptr %3, align 4, !tbaa !8
  %34 = load i32, ptr @last, align 4, !tbaa !8
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %35
  %37 = getelementptr inbounds %struct.node, ptr %36, i32 0, i32 2
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %37, ptr noundef nonnull align 1 dereferenceable(1) %2)
  store i32 %33, ptr %38, align 4, !tbaa !8
  br label %39

39:                                               ; preds = %32
  %40 = load i32, ptr @last, align 4, !tbaa !8
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %41
  %43 = getelementptr inbounds %struct.node, ptr %42, i32 0, i32 0
  %44 = load i32, ptr %43, align 8, !tbaa !22
  store i32 %44, ptr @last, align 4, !tbaa !8
  br label %18, !llvm.loop !23

45:                                               ; preds = %30
  %46 = load i32, ptr @last, align 4, !tbaa !8
  %47 = icmp eq i32 %46, -1
  br i1 %47, label %48, label %53

48:                                               ; preds = %45
  %49 = load i32, ptr %3, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %50
  %52 = getelementptr inbounds %struct.node, ptr %51, i32 0, i32 0
  store i32 0, ptr %52, align 8, !tbaa !22
  br label %147

53:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  %54 = load i32, ptr @last, align 4, !tbaa !8
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %55
  %57 = getelementptr inbounds %struct.node, ptr %56, i32 0, i32 2
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %57, ptr noundef nonnull align 1 dereferenceable(1) %2)
  %59 = load i32, ptr %58, align 4, !tbaa !8
  store i32 %59, ptr %4, align 4, !tbaa !8
  %60 = load i32, ptr %4, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %61
  %63 = getelementptr inbounds %struct.node, ptr %62, i32 0, i32 1
  %64 = load i32, ptr %63, align 4, !tbaa !10
  %65 = load i32, ptr @last, align 4, !tbaa !8
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %66
  %68 = getelementptr inbounds %struct.node, ptr %67, i32 0, i32 1
  %69 = load i32, ptr %68, align 4, !tbaa !10
  %70 = add nsw i32 %69, 1
  %71 = icmp eq i32 %64, %70
  br i1 %71, label %72, label %78

72:                                               ; preds = %53
  %73 = load i32, ptr %4, align 4, !tbaa !8
  %74 = load i32, ptr %3, align 4, !tbaa !8
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %75
  %77 = getelementptr inbounds %struct.node, ptr %76, i32 0, i32 0
  store i32 %73, ptr %77, align 8, !tbaa !22
  br label %146

78:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  %79 = load i32, ptr @sz, align 4, !tbaa !8
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr @sz, align 4, !tbaa !8
  store i32 %79, ptr %5, align 4, !tbaa !8
  %81 = load i32, ptr @last, align 4, !tbaa !8
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %82
  %84 = getelementptr inbounds %struct.node, ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 4, !tbaa !10
  %86 = add nsw i32 %85, 1
  %87 = load i32, ptr %5, align 4, !tbaa !8
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %88
  %90 = getelementptr inbounds %struct.node, ptr %89, i32 0, i32 1
  store i32 %86, ptr %90, align 4, !tbaa !10
  %91 = load i32, ptr %4, align 4, !tbaa !8
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %92
  %94 = getelementptr inbounds %struct.node, ptr %93, i32 0, i32 0
  %95 = load i32, ptr %94, align 8, !tbaa !22
  %96 = load i32, ptr %5, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %97
  %99 = getelementptr inbounds %struct.node, ptr %98, i32 0, i32 0
  store i32 %95, ptr %99, align 8, !tbaa !22
  %100 = load i32, ptr %4, align 4, !tbaa !8
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %101
  %103 = getelementptr inbounds %struct.node, ptr %102, i32 0, i32 2
  %104 = load i32, ptr %5, align 4, !tbaa !8
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %105
  %107 = getelementptr inbounds %struct.node, ptr %106, i32 0, i32 2
  %108 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEaSERKS6_(ptr noundef nonnull align 8 dereferenceable(48) %107, ptr noundef nonnull align 8 dereferenceable(48) %103)
  br label %109

109:                                              ; preds = %130, %78
  %110 = load i32, ptr @last, align 4, !tbaa !8
  %111 = icmp ne i32 %110, -1
  br i1 %111, label %112, label %121

112:                                              ; preds = %109
  %113 = load i32, ptr @last, align 4, !tbaa !8
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %114
  %116 = getelementptr inbounds %struct.node, ptr %115, i32 0, i32 2
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %116, ptr noundef nonnull align 1 dereferenceable(1) %2)
  %118 = load i32, ptr %117, align 4, !tbaa !8
  %119 = load i32, ptr %4, align 4, !tbaa !8
  %120 = icmp eq i32 %118, %119
  br label %121

121:                                              ; preds = %112, %109
  %122 = phi i1 [ false, %109 ], [ %120, %112 ]
  br i1 %122, label %123, label %136

123:                                              ; preds = %121
  %124 = load i32, ptr %5, align 4, !tbaa !8
  %125 = load i32, ptr @last, align 4, !tbaa !8
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %126
  %128 = getelementptr inbounds %struct.node, ptr %127, i32 0, i32 2
  %129 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %128, ptr noundef nonnull align 1 dereferenceable(1) %2)
  store i32 %124, ptr %129, align 4, !tbaa !8
  br label %130

130:                                              ; preds = %123
  %131 = load i32, ptr @last, align 4, !tbaa !8
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %132
  %134 = getelementptr inbounds %struct.node, ptr %133, i32 0, i32 0
  %135 = load i32, ptr %134, align 8, !tbaa !22
  store i32 %135, ptr @last, align 4, !tbaa !8
  br label %109, !llvm.loop !25

136:                                              ; preds = %121
  %137 = load i32, ptr %5, align 4, !tbaa !8
  %138 = load i32, ptr %3, align 4, !tbaa !8
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %139
  %141 = getelementptr inbounds %struct.node, ptr %140, i32 0, i32 0
  store i32 %137, ptr %141, align 8, !tbaa !22
  %142 = load i32, ptr %4, align 4, !tbaa !8
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %143
  %145 = getelementptr inbounds %struct.node, ptr %144, i32 0, i32 0
  store i32 %137, ptr %145, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  br label %146

146:                                              ; preds = %136, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  br label %147

147:                                              ; preds = %146, %48
  %148 = load i32, ptr %3, align 4, !tbaa !8
  store i32 %148, ptr @last, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  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: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 1 dereferenceable(1)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEaSERKS6_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

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

attributes #0 = { mustprogress 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 }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !9, i64 4}
!11 = !{!"_ZTS4node", !9, i64 0, !9, i64 4, !12, i64 8}
!12 = !{!"_ZTSSt3mapIciSt4lessIcESaISt4pairIKciEEE", !13, i64 0}
!13 = !{!"_ZTSSt8_Rb_treeIcSt4pairIKciESt10_Select1stIS2_ESt4lessIcESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSNSt8_Rb_treeIcSt4pairIKciESt10_Select1stIS2_ESt4lessIcESaIS2_EE13_Rb_tree_implIS6_Lb1EEE", !15, i64 0, !17, i64 8}
!15 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIcEE", !16, i64 0}
!16 = !{!"_ZTSSt4lessIcE"}
!17 = !{!"_ZTSSt15_Rb_tree_header", !18, i64 0, !21, i64 32}
!18 = !{!"_ZTSSt18_Rb_tree_node_base", !19, i64 0, !20, i64 8, !20, i64 16, !20, i64 24}
!19 = !{!"_ZTSSt14_Rb_tree_color", !6, i64 0}
!20 = !{!"any pointer", !6, i64 0}
!21 = !{!"long", !6, i64 0}
!22 = !{!11, !9, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}


; 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.node = type { i32, i32, %"class.std::map" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int>>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int>>, std::less<char>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

@st = external dso_local global [1000007 x %struct.node], align 16
@sz = external dso_local local_unnamed_addr global i32, align 4
@last = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3addc(i8 noundef signext %0) local_unnamed_addr #0 {
  %2 = alloca i8, align 1
  store i8 %0, ptr %2, align 1, !tbaa !5
  %3 = load i32, ptr @sz, align 4, !tbaa !8
  %4 = add nsw i32 %3, 1
  store i32 %4, ptr @sz, align 4, !tbaa !8
  %5 = load i32, ptr @last, align 4, !tbaa !8
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %6, i32 1
  %8 = load i32, ptr %7, align 4, !tbaa !10
  %9 = add nsw i32 %8, 1
  %10 = sext i32 %3 to i64
  %11 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %10
  %12 = getelementptr inbounds i8, ptr %11, i64 4
  store i32 %9, ptr %12, align 4, !tbaa !10
  %.not24 = icmp eq i32 %5, -1
  br i1 %.not24, label %.critedge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %1, %18
  %13 = phi i32 [ %25, %18 ], [ %5, %1 ]
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %14, i32 2
  %16 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 1 dereferenceable(1) %2)
  %17 = load i32, ptr %16, align 4, !tbaa !8
  %.not21 = icmp eq i32 %17, 0
  %.pre.pre = load i32, ptr @last, align 4, !tbaa !8
  br i1 %.not21, label %18, label %.critedge

18:                                               ; preds = %.lr.ph
  %19 = sext i32 %.pre.pre to i64
  %20 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %19, i32 2
  %21 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %20, ptr noundef nonnull align 1 dereferenceable(1) %2)
  store i32 %3, ptr %21, align 4, !tbaa !8
  %22 = load i32, ptr @last, align 4, !tbaa !8
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %23
  %25 = load i32, ptr %24, align 8, !tbaa !22
  store i32 %25, ptr @last, align 4, !tbaa !8
  %.not = icmp eq i32 %25, -1
  br i1 %.not, label %.critedge.thread, label %.lr.ph, !llvm.loop !23

.critedge:                                        ; preds = %.lr.ph
  %26 = icmp eq i32 %.pre.pre, -1
  br i1 %26, label %.critedge.thread, label %27

.critedge.thread:                                 ; preds = %18, %1, %.critedge
  store i32 0, ptr %11, align 8, !tbaa !22
  br label %68

27:                                               ; preds = %.critedge
  %28 = sext i32 %.pre.pre to i64
  %29 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %28, i32 2
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %29, ptr noundef nonnull align 1 dereferenceable(1) %2)
  %31 = load i32, ptr %30, align 4, !tbaa !8
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %32
  %34 = getelementptr inbounds i8, ptr %33, i64 4
  %35 = load i32, ptr %34, align 4, !tbaa !10
  %36 = load i32, ptr @last, align 4, !tbaa !8
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %37, i32 1
  %39 = load i32, ptr %38, align 4, !tbaa !10
  %40 = add nsw i32 %39, 1
  %41 = icmp eq i32 %35, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %27
  store i32 %31, ptr %11, align 8, !tbaa !22
  br label %68

43:                                               ; preds = %27
  %44 = load i32, ptr @sz, align 4, !tbaa !8
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr @sz, align 4, !tbaa !8
  %46 = sext i32 %44 to i64
  %47 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %46
  %48 = getelementptr inbounds i8, ptr %47, i64 4
  store i32 %40, ptr %48, align 4, !tbaa !10
  %49 = load i32, ptr %33, align 8, !tbaa !22
  store i32 %49, ptr %47, align 8, !tbaa !22
  %50 = getelementptr inbounds i8, ptr %33, i64 8
  %51 = getelementptr inbounds i8, ptr %47, i64 8
  %52 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEaSERKS6_(ptr noundef nonnull align 8 dereferenceable(48) %51, ptr noundef nonnull align 8 dereferenceable(48) %50)
  %.pr23 = load i32, ptr @last, align 4, !tbaa !8
  %.not2226 = icmp eq i32 %.pr23, -1
  br i1 %.not2226, label %.critedge2, label %.lr.ph27

.lr.ph27:                                         ; preds = %43, %59
  %53 = phi i32 [ %67, %59 ], [ %.pr23, %43 ]
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %54, i32 2
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %55, ptr noundef nonnull align 1 dereferenceable(1) %2)
  %57 = load i32, ptr %56, align 4, !tbaa !8
  %58 = icmp eq i32 %57, %31
  br i1 %58, label %59, label %.critedge2

59:                                               ; preds = %.lr.ph27
  %60 = load i32, ptr @last, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %61, i32 2
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %62, ptr noundef nonnull align 1 dereferenceable(1) %2)
  store i32 %44, ptr %63, align 4, !tbaa !8
  %64 = load i32, ptr @last, align 4, !tbaa !8
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [1000007 x %struct.node], ptr @st, i64 0, i64 %65
  %67 = load i32, ptr %66, align 8, !tbaa !22
  store i32 %67, ptr @last, align 4, !tbaa !8
  %.not22 = icmp eq i32 %67, -1
  br i1 %.not22, label %.critedge2, label %.lr.ph27, !llvm.loop !25

.critedge2:                                       ; preds = %.lr.ph27, %59, %43
  store i32 %44, ptr %11, align 8, !tbaa !22
  store i32 %44, ptr %33, align 8, !tbaa !22
  br label %68

68:                                               ; preds = %42, %.critedge2, %.critedge.thread
  store i32 %3, ptr @last, align 4, !tbaa !8
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEaSERKS6_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

attributes #0 = { mustprogress 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" }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !9, i64 4}
!11 = !{!"_ZTS4node", !9, i64 0, !9, i64 4, !12, i64 8}
!12 = !{!"_ZTSSt3mapIciSt4lessIcESaISt4pairIKciEEE", !13, i64 0}
!13 = !{!"_ZTSSt8_Rb_treeIcSt4pairIKciESt10_Select1stIS2_ESt4lessIcESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSNSt8_Rb_treeIcSt4pairIKciESt10_Select1stIS2_ESt4lessIcESaIS2_EE13_Rb_tree_implIS6_Lb1EEE", !15, i64 0, !17, i64 8}
!15 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIcEE", !16, i64 0}
!16 = !{!"_ZTSSt4lessIcE"}
!17 = !{!"_ZTSSt15_Rb_tree_header", !18, i64 0, !21, i64 32}
!18 = !{!"_ZTSSt18_Rb_tree_node_base", !19, i64 0, !20, i64 8, !20, i64 16, !20, i64 24}
!19 = !{!"_ZTSSt14_Rb_tree_color", !6, i64 0}
!20 = !{!"any pointer", !6, i64 0}
!21 = !{!"long", !6, i64 0}
!22 = !{!11, !9, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}


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